import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:mes_app/color/hex.dart' show HexColor;
import 'package:mes_app/utils/styles.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

class HomeMessageController extends GetxController {}

class HomeMessageView extends GetView<HomeMessageController> {
  const HomeMessageView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: HexColor(HexColor.colorF9f9),
      appBar: TDNavBar(
        title: '消息',
        titleColor: HexColor(HexColor.color0000),
        titleFontWeight: FontWeight.w700,
        titleFont: Font(size: StylesUtils.fontSize16.toInt(), lineHeight: 1),
        backgroundColor: Colors.white,
        screenAdaptation: true,
        useDefaultBack: false,
        useBorderStyle: true,
        titleMargin: 0,
        border: TDNavBarItemBorder(
          width: 1,
          color: HexColor(HexColor.colorF9f9),
        ),
      ),
      body: SingleChildScrollView(
        padding: EdgeInsets.symmetric(horizontal: 15),
        child: Column(
          children: [
            for (var i = 0; i < 10; i++)
              Container(
                height: 70,
                margin: EdgeInsets.only(top: 15),
                decoration: BoxDecoration(
                  color: HexColor(HexColor.colorFfff),
                  border: Border.all(
                    width: 1,
                    color: HexColor(HexColor.colorF2f2),
                  ),
                ),
                child: Column(
                  children: [
                    SizedBox(
                      height: 40,
                      child: Row(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            width: 40,
                            alignment: Alignment.center,
                            child: Icon(
                              TDIcons.chat_bubble_smile,
                              size: 15,
                            ),
                          ),
                          Expanded(
                            child: Container(
                              alignment: Alignment.centerLeft,
                              child: TDText(
                                '您有新的报工信息，请注意查看',
                                style: StylesUtils.customTextStyle(
                                  color: HexColor.color3333,
                                ),
                              ),
                            ),
                          ),
                          Container(
                            width: 40,
                            alignment: Alignment.center,
                            child: TDBadge(
                              TDBadgeType.redPoint,
                              color: HexColor(HexColor.colorFf62),
                            ),
                          )
                        ],
                      ),
                    ),
                    Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Container(
                          width: 40,
                          alignment: Alignment.center,
                          child: Icon(
                            TDIcons.task_time,
                            size: 15,
                          ),
                        ),
                        Expanded(
                          child: Container(
                            alignment: Alignment.centerLeft,
                            child: TDText(
                              '2025-07-01 15:29:39',
                              style: StylesUtils.customTextStyle(
                                color: HexColor.colorCccc,
                                fontSize: StylesUtils.fontSize13,
                              ),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            for (var i = 0; i < 5; i++)
              Container(
                height: 70,
                margin: EdgeInsets.only(top: 15),
                decoration: BoxDecoration(
                  color: HexColor(HexColor.colorFfff),
                  border: Border.all(
                    width: 1,
                    color: HexColor(HexColor.colorF2f2),
                  ),
                ),
                child: Column(
                  children: [
                    SizedBox(
                      height: 40,
                      child: Row(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            width: 40,
                            alignment: Alignment.center,
                            child: Icon(
                              TDIcons.chat_bubble_smile,
                              size: 15,
                            ),
                          ),
                          Expanded(
                            child: Container(
                              alignment: Alignment.centerLeft,
                              child: TDText(
                                '您有新的报工信息，请注意查看',
                                style: StylesUtils.customTextStyle(
                                  color: HexColor.color3333,
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                    Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Container(
                          width: 40,
                          alignment: Alignment.center,
                          child: Icon(
                            TDIcons.task_time,
                            size: 15,
                          ),
                        ),
                        Expanded(
                          child: Container(
                            alignment: Alignment.centerLeft,
                            child: TDText(
                              '2025-07-01 15:29:39',
                              style: StylesUtils.customTextStyle(
                                color: HexColor.colorCccc,
                                fontSize: StylesUtils.fontSize13,
                              ),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
          ],
        ),
      ),
    );
  }
}
